﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ChiTietSanPham.aspx.cs" Inherits="Web.ChiTietSanPham" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="list-product">
<div class="header-listproduct">
<h3>Chi tiết sản phẩm</h3>
</div>
<div class="content-listproduct">
    
    
    <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" 
        onitemcommand="DataList1_ItemCommand">
        <ItemTemplate>
        <div style="width:100%">
            <div style="width:100%; height:193px; float:left">
                <div style="width:200px; height:193px; float:left ; text-align:center">
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Image") %>' />
                </div>
                <div style=" height:193px; float:left; margin-left:80px">
                    <h2><asp:Label ID="Label2" runat="server" Text='<%# Eval("Name") %>'/></h2>
                    <table>
                        <tr>
                            <td style="width:120px">
                                <h4>Giá</h4>
                            </td>
                            <td>
                                <asp:Label ID="Label3" runat="server" Text='<%#Format_Price(Eval("Price").ToString()) %>'/>
                            </td>

                        </tr>
                        <tr>
                            <td style="width:120px">
                                <h4>Hãng Sản Xuất</h4>
                            </td>
                            <td >
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("HSX") %> '/>
                            </td>
                        </tr>
                        <tr>
                            
                            <td >
                                <asp:Button ID="mua"  Text="Đặt mua" runat="server" CommandName="Order" CommandArgument='<%#Eval("Id") %>' />
                            </td>
                        </tr>
                    </table>
                    
            
                </div>
            </div>
            <div style=" padding:5px">
               
                <asp:Label ID="Label4" runat="server" Text='<%# Eval("Detail") %> '/>
                <h4>Câu hình tối thiểu</h4>
                <table>
                        <tr>
                            <td style="width:150px">
                                <h4>OS</h4>
                            </td>
                            <td style="width:300px">
                                <asp:Label ID="Label5" runat="server" Text='<%# Eval("Os") %> '/>
                            </td>

                        </tr>
                        <tr>
                            <td style="width:150px">
                                <h4>Processor</h4>
                            </td>
                            <td style="width:300px"">
                                <asp:Label ID="Label6" runat="server" Text='<%# Eval("Processor") %> '/>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:150px">
                                <h4>Memory</h4>
                            </td>
                            <td style="width:300px"">
                                <asp:Label ID="Label7" runat="server" Text='<%# Eval("Memory") %> '/>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:150px">
                                <h4>Hard Drive</h4>
                            </td>
                            <td style="width:300px"">
                                <asp:Label ID="Label8" runat="server" Text='<%# Eval("HD") %> '/>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:150px">
                                <h4>Video Memory</h4>
                            </td>
                            <td style="width:300px"">
                                <asp:Label ID="Label9" runat="server" Text='<%# Eval("VM") %> '/>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:150px">
                                <h4>Sound Card</h4>
                            </td>
                            <td style="width:300px"">
                                <asp:Label ID="Label10" runat="server" Text='<%# Eval("SC") %> '/>
                            </td>
                        </tr>
                        <tr>
                            <td style="width:150px">
                                <h4>DirectX</h4>
                            </td>
                            <td style="width:300px"">
                                <asp:Label ID="Label11" runat="server" Text='<%# Eval("DirectX") %> '/>
                            </td>
                        </tr>
                    </table>
            </div>
        
        </div>
            
            
        </ItemTemplate>
    </asp:DataList>
    
    

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [Product] WHERE ([Id] = @Id)">
        <SelectParameters>
            <asp:QueryStringParameter Name="Id" QueryStringField="pid" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    
    

</div>
   <h2>Danh Sách Các cửa hàng có thể mua Game</h2>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2" AllowPaging="True" BackColor="White" 
        BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" 
        ForeColor="Black" GridLines="Vertical" Width="590px" AllowSorting="True">
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:TemplateField HeaderText="Tên Cửa Hàng">
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink1" runat="server"  Text='<%#Eval("ShopName") %>'
                                NavigateUrl='<%# "~/chitietcuahang.aspx?sid="+ Eval("Idshop") %>'></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
            <asp:BoundField DataField="Address" HeaderText="Địa Chỉ" 
                 />
            <asp:BoundField DataField="Price" HeaderText="Giá Gốc" />
            <asp:BoundField DataField="Prince_New" HeaderText="Giá Cửa Hàng" />
            
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT Name,Price,Prince_New ,ShopName, Address, Tel,Idshop FROM Shop,DetailShop,Product WHERE Shop.Idshop=DetailShop.Id_Shop AND  DetailShop.Id_Product=Product.Id AND Product.Id=@Id ORDER BY Prince_New ">
        <SelectParameters>
            <asp:QueryStringParameter Name="Id" QueryStringField="pid" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
   
</div>
</asp:Content>
